'use strict';
import * as types from '../common/ActionTypes';

const initialState = {
    isFetching: false,
    ad_data:[],
}

export default function adSlider(state = initialState, action){
    switch (action.type) {
        //正在获取轮播列表数据
        case types.FETCH_AD_SILDER_DATA_ACTION:
                  return Object.assign({}, state, {
                      isFetching: true
                  });
        //获取到轮播列表数据
        case types.RECEIVE_AD_SILDER_DATA_ACTION:
                  return Object.assign({}, state, {
                       isFetching: false,
                       ad_data: action.ad_data,
                  });
        default:
            return state;
    }
}
